<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>归还图书</title>
    <%--引入vue的js--%>
    <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
    <%--引入element的js--%>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="/js/axios.min.js"></script>
    <%--引入elementui的样式--%>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
    <el-table
            :data="books"
            border
            style="width: 100%">
        <el-table-column
                prop="id"
                label="借阅编号">
        </el-table-column>
        <el-table-column
                prop="user.userNick"
                label="用户名">
        </el-table-column>
        </el-table-column>
        <el-table-column
                prop="user.userPhone"
                label="用户联系方式"
        >
        </el-table-column>
        <el-table-column
                prop="borrowDate"
                label="借出日期">
        </el-table-column>
        <el-table-column
                prop="book.bookName"
                label="图书名称">
        </el-table-column>
        <el-table-column
                prop="booktype.booktypes"
                label="图书类型">
        </el-table-column>
    </el-table>
</div>
</body>
<script>
    let app=new Vue({
        el: "#app",
        data: {
            //借出图书表格的数据
            books: [],
        },
        created(){
            this.loadLend();
        },
        methods:{
            //初始化借出图书表格数据
            loadLend(){
                axios.post("/borrow/lend").then(result=>{
                    this.books=result.data.data;
                })
            },
        }
    })
</script>
</html>
